package com.haojin.java;

public class InstanceTest {
	public static void main(String[] args) {
		InstanceTest test = new InstanceTest();
		test.method(new Graduate());
	}

	public void method(Person e) {

		String info = e.getlnof();
		System.out.println(info);

		if (e instanceof Graduate) {
			System.out.println("a graduate student");
			System.out.println("a student");
			System.out.println("a person");
		} else if (e instanceof Student) {
			System.out.println("a student");
			System.out.println("a person");
		} else {
			System.out.println("a person");
		}
	}
}

